import tkinter as tk


class application(tk.Frame):
    def __init__(self, master=None):
        self.master = master
        super().__init__(master)
        self.creatWidget()

    def creatWidget(self):
        ls_tmp = []
        w = 0
        self.photo = tk.PhotoImage(file='img.png')
        for i in range(10):
            btn = tk.Button(self.master, width=100, height=200, image=self.photo)
            btn.place(x=50 + w, y=100)
            w += 50
            btn.bind('<Button-1>', self.up)

    def up(self, event):
        y = 80 if event.widget.winfo_y() == 100 else 100
        event.widget.place(y=y)


window = tk.Tk()
window.title("扑克")
window.geometry('660x400')
app = application(window)
window.mainloop()
